{include file="common/header"}
<link href="/static/admin/css/other.css" rel="stylesheet">
<main class="lyear-layout-content">
    <div class="container-fluid">
        <div class="row ant-menu-submenu">
            <div class="col-lg-12 col-b90">
                <div class="card">
                    <div class="right-card-header card-header">
                        <h4>{:lang('set.deployment')}</h4>
                    </div>
                    <div class="card-body access_code">
                        <div class="row">
                            <div class="col-lg-6">
                                <h5>{:lang('set.chat_style')}</h5>
                                <div class="btn-group">
                                    <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                        <span class="cur-text">{:lang('set.standard_window')}</span>
                                        <span class="caret-toggle">
                                            <i class="iconfont icon-xiangxia"></i>
                                        </span>
                                    </button>
                                    <ul class="dropdown-menu">
                                        <li><a data-type="1">{:lang('set.standard_window')}</a></li>
                                        <li><a data-type="2">{:lang('set.mini_window')}</a></li>
                                    </ul>
                                </div>
                            </div>
                            <div class="form-group col-md-12 mt-50">
                                <button type="submit" class="btn btn-default access-1" ty="1">{:lang('set.chat_code')}</button>
                                <button type="submit" class="btn btn-default access-2" ty="2">{:lang('set.chat_page')}</button>
                                <button type="submit" class="btn btn-default access-3" ty="3">{:lang('set.chat_link')}</button>
                                <!--<button type="button" class="btn btn-success copy-link hide" data-clipboard-action="copy" data-clipboard-target="#copyVal">{:lang('public.copy_code')}</button>-->
                            </div>
                            <div class="access-code-lists chat_code col-lg-6 hide">
                                <pre id="copyVal-1"></pre>
                            </div>
                            <div class="access-code-lists chat_page col-lg-6 hide">
                                <pre id="copyVal-2">
                                    &lt;link rel="stylesheet" href="{:request()->domain()}/chat/css/chat.css"&gt;
                                    &lt;div id="IM_chat-lists" class="IM_chat-form"&gt;
                                        &lt;i class="chat-icon"&gt;&lt;/i&gt;
                                        &lt;div class="IM_chat-lists"&gt;
                                        &lt;a class="IM_chat-item" href="{:exclusiveUrl(['cuid'=>$custs['id'],'uname'=>$custs['uname'],'gid'=>$custs['group_id'],'wname'=>$main_uname])}" target="_blank"&gt;{:lang('public.Online consulting')}&lt;/a&gt;
                                        {foreach $groups as $key=>$item}
                                            &lt;a class="IM_chat-item" href="{:exclusiveUrl(['cuid'=>0,'uname'=>0,'gid'=>$item['id'],'wname'=>0])}" target="_blank"&gt;{$item['name']}&lt;/a&gt;
                                        {/foreach}
                                        &lt;/div&gt;
                                    &lt;/div&gt;
                                </pre>
                            </div>
                            <div class="access-code-lists chat_link col-lg-6 hide">
                            {foreach $groups as $key=>$item}
                                <div class="input-group">
                                    <span class="input-group-addon">{$item['name']}</span>
                                    <input type="text" class="form-control" value="{:exclusiveUrl(['cuid'=>0,'uname'=>0,'gid'=>$item['id'],'wname'=>0])}">
                                    <span class="input-group-btn">
                                        <button class="copy-link btn btn-default" id="copyVal_{$item['id']}" data-id="{$item['id']}" data-clipboard-text="{:exclusiveUrl(['cuid'=>0,'uname'=>0,'gid'=>$item['id'],'wname'=>0])}" type="button">{:lang('public.copy')}</button>
                                    </span>
                                </div>
                            {/foreach}
                                <div class="input-group">
                                    <span class="input-group-addon">{:lang('set.exclusive_links')}</span>
                                    <input type="text" class="form-control" value="{:exclusiveUrl(['cuid'=>$custs['id'],'uname'=>$custs['uname'],'gid'=>$custs['group_id'],'wname'=>$main_uname])}">
                                    <span class="input-group-btn">
                                        <button class="copy-link btn btn-default" id="copyVal_0" data-id="0" data-clipboard-text="{:exclusiveUrl(['cuid'=>$custs['id'],'uname'=>$custs['uname'],'gid'=>$custs['group_id'],'wname'=>$main_uname])}" type="button">{:lang('public.copy')}</button>
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</main>
{include file="common/footer"}
<script type="text/javascript" src="/static/admin/js/set.js"></script>
<script type="text/javascript" src="/static/admin/js/clipboard.min.js"></script>
<script type="text/javascript">
    let IM_config = {
        accessCode: "{:adminUrl('admin/Set/access_code')}"
    };

    $('.input-group .copy-link').on('click', function() {
        var obj = $(this);
        var copy_id = $(this).attr('data-id');
        var clipboard = new ClipboardJS('#copyVal_' + copy_id);
        clipboard.on('success', function(e) {
            we_im_msg("{:lang('public.copy_success')}");
            obj.parent().siblings('input').select();
        });
    });
</script>